import { chekPassword, chekUsername } from "./utils/check"
import './index.css'
import './index.less'
import imgLogo from './assets/logo.png'
const button = document.querySelector('button')
button.addEventListener('click', function () {
    const usernameval = document.querySelector('.username').value
    const passwordval = document.querySelector('.password').value
    if (chekUsername(usernameval) === false) {
        alert('用户名不合法')
        return
    }
    if (chekPassword(passwordval) === false) {
        alert('密码不合法')
        return
    }
    alert('注册成功')
})

axios.post('https://hmajax.itheima.net/api/register', {
    username: usernameVal,
    password: passwordVal,
})
    .then((res) => {
        // then 处理成功
        console.log(res.data.data.id)
        alert(`注册成功，用户id为${res.data.data.id}`)
    })
    .catch((err) => {
        // catch 处理失败
        console.log(err)
        alert(`注册失败${err.response.data.message}`)
    })


const username = 'itheima'
console.log(username);
console.log(`用户名${username}`);
const arr = [1, 2, 3, 4, 5]
const res = arr.map((item) => item * 2)
console.log(resdddddd);

